Skip to content

test: Speed up the unit, integration and E2E test suites - #1106

Merged
vdusek merged 9 commits into
masterfrom
optimize-test-scheduling
Aug 28, 2026
Merged

test: Speed up the unit, integration and E2E test suites#1106
vdusek merged 9 commits into
masterfrom
optimize-test-scheduling

Conversation

@vdusek

@vdusek vdusek commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The CI critical path is the E2E job at ~5.9 min; it and the unit suite mostly wait rather than work (master run 32966697702).

E2E

  • sdk_wheel_path locks the wheel build on a shared file, but keeps the "already built" marker under the per-worker getbasetemp(), so all 16 workers rebuild the wheel in turn behind the lock (first worker's first test at 41s, last at 144s). The marker moves next to the lock, into the shared parent dir.
  • test_crawlee/test_scrapy hold the 6 slowest tests but collect last, and xdist distributes in collection order - test_adaptive_playwright_crawler (167s) ran t=155s to 322s, ~100s after every other worker went idle. A pytest_collection_modifyitems hook puts them first.

Unit

  • test_reboot_proceeds_when_event_listener_exceeds_timeout: 30.1s of 80.5s, because its listener slept 60s and leaving the Actor context waited out cleanup_timeout. It releases the listener via asyncio.Event instead (-> 0.17s).
  • 12 tests slept 1s each for mtime granularity; they backdate the input file with os.utime.
  • tests_concurrency 1 -> 4 (the suite ran at ~21% CPU on one worker), plus --dist worksteal so a worker that draws several slow tests stops being the critical path.

Locally 81.0s -> 15.5s at 4 workers, 572 passing. Projected CI: unit ~2 -> ~1 min, E2E 5.9 -> ~4 min. E2E is unverified locally (no platform token), so the first CI run is the check.

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Aug 27, 2026
@vdusek vdusek self-assigned this Aug 27, 2026
@github-actions github-actions Bot added this to the 148th sprint - Tooling team milestone Aug 27, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Aug 27, 2026
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.59%. Comparing base (a70336d) to head (61b4108).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1106   +/-   ##
=======================================
  Coverage   92.59%   92.59%           
=======================================
  Files          51       51           
  Lines        3445     3445           
=======================================
  Hits         3190     3190           
  Misses        255      255           
Flag Coverage Δ
e2e 33.43% <ø> (ø)
integration 54.51% <ø> (+0.02%) ⬆️
unit 89.08% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek requested a review from Pijukatel August 27, 2026 09:57
@vdusek
vdusek marked this pull request as ready for review August 27, 2026 09:57
Comment thread .github/workflows/_checks.yaml
@vdusek
vdusek merged commit a770806 into master Aug 28, 2026
31 checks passed
@vdusek
vdusek deleted the optimize-test-scheduling branch August 28, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants